package com.dashu.authority.util;

import java.util.Map;

import com.dashu.authority.common.Constant;

import net.sf.json.JSONObject;

public class ReturnMessage {
	public static String getJsonString(Object obj){
		 Map<String, Object> map=AuthorityServiceUtil.OperaSuccessMap(Constant.OPERATION_QUERY);
		 map.put("data", obj);
		 JSONObject json=JSONObject.fromObject(map);
		 return json.toString();
	}
	
	public static String getJsonString(Object obj,String pathCode){
		 Map<String, Object> map=AuthorityServiceUtil.OperaSuccessMap(Constant.OPERATION_QUERY);
		 map.put("data", obj);
		// map.put("path_code", pathCode);
		 JSONObject json=JSONObject.fromObject(map);
		 return json.toString();
	}
	
	public static String getJsonString(Object obj,Map<String, Long> auths){
		 Map<String, Object> map=AuthorityServiceUtil.OperaSuccessMap(Constant.OPERATION_QUERY);
		 map.put("data", obj);
		 map.put("auths", auths);
		 JSONObject json=JSONObject.fromObject(map);
		 return json.toString();
	}
	
}
